<template>
    <div class="adderss-box">
        <img src="http://img.xianyufanshen.net//pay/images/zhifuchenggong@2x.png" alt="">
        <h2  v-if="lang=='zh' ">恭喜您，支付成功！</h2>
        <h2 v-else>Congratulations, payment success！</h2>
        <div v-if="lang=='zh' ">
            <p v-if="type==1">我们将联系卖家为您发货，请耐心等待</p>
            <p v-if="type==2">我们将联系对方是否同意置换，请耐心等待</p>
            <p v-if="type==3">我们将在1~3个工作日，以短信形式通知您审核结果请耐心等待</p>
        </div>
        <div v-else>
            <p v-if="type==1">We will contact the seller to ship the goods for you, please be patient</p>
            <p v-if="type==2">We will contact the other party to agree to the replacement, please be patient</p>
            <p v-if="type==3">We will notify you of the results of the review by SMS within 1-3 business days. Please be patient.</p>
        </div>      
        <!-- <div v-if="type==3" class="btn" @click="goSelect">返回选择藏品</div> -->
        <div v-if="lang=='zh' " class="btn" @click="goIndex">返回首页</div>
        <div v-else class="btn" @click="goIndex">Back to home</div>
    </div>
</template>
<script>
import { postBond , getGoodsDetails ,} from '@/api/goods';
import { Loading,Toast,Cell, CellGroup ,RadioGroup, Radio,} from 'vant';

export default {
    name:'paySuccess',
    data (){
        return{
        lang:'zh',//当前网页语言类型 zh 中文  en 英语  
           userId:0,//用户id 
           type:1,//type=1购买，2置换 3、发布藏品
        }
    },
    //实例创建完成后被立即调用
    created (){
        //获得语言类型lang
        if(this.$route.query.lang) {
            this.lang = this.$route.query.lang;
        }
        //获取用户id
        if(this.$route.query.userId && this.$route.query.userId > 0){
            this.userId = this.$route.query.userId;
             //把用户id存储在缓存
             window.localStorage.setItem("userId",this.userId);
        }else{
            this.userId = window.localStorage.getItem("userId");
        }
        //获得类型
        if(this.$route.query.type && this.$route.query.type > 0){
            this.type = this.$route.query.type;
        }
        //清空缓存
        window.localStorage.setItem("selectedData",'');
    },
    //
    methods:{
        //返回首页
        goIndex(){
            let para = {};
            para.linkType = "index";
            this.interaction.hLinkToApp(para);	
        },
        //返回选择藏品
        goSelect(){
            
        }
    }
    
}
</script>

<style lang="stylus" scoped>
.adderss-box{
    width :100%;
    height:100%;
    background :#fff;
    text-align:center;
    position:fixed;
    bottom :0;
    img{
        width:1.466667rem;
        height:1.466667rem;
        margin :0 auto;
        margin-top :1.066667rem;
    }
    h2{
        font-family:PingFangSC-Regular;
        font-size:.48rem;
        color:#494949;
        letter-spacing:.006667rem;
        text-align:center;
        margin-top :.266667rem;
        margin-bottom :1.333333rem;
    }
    p{
       font-family:PingFangSC-Regular;
        font-size:.373333rem;
        color:#494949;
        letter-spacing:.005067rem;
        text-align:center;
        line-height:.693333rem;
        padding 0 6%;
    }
    .btn{
        border:2px solid #cb9c57;
        border-radius:100px;
        width:6.426667rem;
        height:.96rem;
        line-height :.96rem;
        font-family:PingFangSC-Medium;
        font-size:.373333rem;
        color:#cb9c57;
        letter-spacing:.005067rem;
        text-align:center;
        margin :0 auto;
        margin-top :2rem;
    }
}
</style>


